/**
* Copyright (c) 2016 Mirantis Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// MIXINS

.navigation-animation(@color) {
  transform: translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
  backface-visibility: hidden;
  position: relative;
  overflow: hidden;
  &:before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 51%;
    right: 50%;
    bottom: -4px;
    background: @color;
    height: 4px;
    transition-property: left, right;
    transition-duration: 0.3s;
    transition-timing-function: ease-out;
  }
  &:hover {
    text-decoration: none;
    color: @text - 30%;
    &:before {
      left: 0;
      right: 0;
    }
  }
  &:focus {
    text-decoration: none;
    &:before {
      left: 0;
      right: 0;
    }
  }
}

.button-animation(@color) {
  display: inline-block;
  vertical-align: middle;
  transform: translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
  backface-visibility: hidden;
  position: relative;
  background: @color;
  transition-property: color;
  transition-duration: 0.2s;
  &:before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: @color - 30%;
    transform: scale(0);
    transition-property: transform;
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
    border-radius: 4px;
  }
  &:hover {
    background-color: @color;
    &:before {
      transform: scale(1);
    }
  }
  &:focus {
    &:before {
      transform: scale(1);
    }
  }
  &:active {
    &:before {
      transform: scale(1);
    }
  }
}
